package com.ftg.learn.controller;

import com.ftg.learn.pojo.Dept;
import com.ftg.learn.service.DeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootVersion;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "SHENGCHANZHE")
@RestController
@CrossOrigin
public class DeptController {

    @Autowired
    DeptService deptService;

    @ApiOperation(value = "查询部门表")
    @GetMapping("/dept")
    public List<Dept> show() {
        return deptService.show();
    }

    @ApiOperation(value = "测试")
    @GetMapping("/hello")
    public String hello() {
        return "第一个服务器!!!!11111111";
    }

    public static void main(String[] args) {
        String version = SpringBootVersion.getVersion();
        System.out.println(version);
        String implementationVersion = SpringApplication.class.getPackage().getImplementationVersion();
        System.out.println(implementationVersion);
    }
}
